package com.itcase.homework03.work02;

/*
定义一个学生类，里面定义姓名和年龄两个属性。重写toString()方法，改变输出对象时的内容
*/
public class Student {
    private String name;
    private int age;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "{" +
                "姓名：" + name + "，年龄：" + age
                + "}";
    }
}
